package com.slg.android.listenbook.biz.bookcity.model;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Darker on 2015/3/25.
 */
public class BookInfo {

    /**
     * 播音姓名
     */
    private String announcer;// "小胖",
    private String author;// "金满楼",
    private String commentCount;// 197,
    private String commentMean;// "4.65",
    private String cover;// "http://bookpic.u.qiniudn.com/598f7027e64d4a68b4ffb2d2e1323267.jpg",
//    private String desc;// null,
    /**
     * 人气
     */
    private String hot;// 6761,
    private String id;// 4336,
    private String lastUpdateTime;// "2013-12-26 15:52:31",
    /**
     * 书名
     */
    private String name;// "雍正登基",
//    private String restype;// 2,
    /**
     * 集数
     */
    private String sections;// 25,
    private String sort;// 0,
    /**
     * 是否完结
     */
    private String state;// 2,
//    private String type;// 0

    public String getAnnouncer() {
        return announcer;
    }

    public void setAnnouncer(String announcer) {
        this.announcer = announcer;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(String commentCount) {
        this.commentCount = commentCount;
    }

    public String getCommentMean() {
        return commentMean;
    }

    public void setCommentMean(String commentMean) {
        this.commentMean = commentMean;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

//    public String getDesc() {
//        return desc;
//    }
//
//    public void setDesc(String desc) {
//        this.desc = desc;
//    }

    public String getHot() {
        return hot;
    }

    public void setHot(String hot) {
        this.hot = hot;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(String lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

//    public String getRestype() {
//        return restype;
//    }
//
//    public void setRestype(String restype) {
//        this.restype = restype;
//    }

    public String getSections() {
        return sections;
    }

    public void setSections(String sections) {
        this.sections = sections;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

//    public String getType() {
//        return type;
//    }
//
//    public void setType(String type) {
//        this.type = type;
//    }

    public void parseJSON(JSONObject jsonObject){
        if(jsonObject != null) {
            try {
                announcer = jsonObject.getString("announcer");
                author = jsonObject.getString("author");
                commentCount = jsonObject.getString("commentCount");
                commentMean = jsonObject.getString("commentMean");
                cover = jsonObject.getString("cover");
//                desc = jsonObject.optString("cover");
                hot = jsonObject.optString("hot");
                id = jsonObject.getString("id");// 4336,
                lastUpdateTime = jsonObject.getString("lastUpdateTime");// "2013-12-26 15:52:31",
                name = jsonObject.getString("name");// "雍正登基",
//                restype = jsonObject.getString("restype");// 2,
                sections = jsonObject.getString("sections");// 25,
                sort = jsonObject.getString("sort");// 0,
                state = jsonObject.getString("state");// 2,
//                type = jsonObject.getString("type");// 0

            } catch (JSONException e) {
                e.printStackTrace();
            }

        }
    }
}
